package com.sy.simpleegg.base

import androidx.viewbinding.ViewBinding
import com.sy.simpleegg.ext.showToastMsg

abstract class BaseMvpActivity<in V: IView, P: IPresenter<V>, VB: ViewBinding>: BaseActivity<VB>(), IView {


    protected var mPresenter: P? = null

    protected abstract fun createPresenter(): P


    override fun initView() {
        mPresenter = createPresenter()
        mPresenter?.attachView(this as V)
    }

    override fun showToast(msg: String) {
        showToastMsg(msg)
    }

}